package com.example.javabasic.shejimoshi.danli.demo4;

public class Singleton {
    private Singleton(){

    }


    private enum Instance{
        INSTANCE;
        private final Singleton instance;
        Instance(){
            instance = new Singleton();
        }
        private Singleton getInstance(){
            return instance;
        }
    }


    public static Singleton getInstance(){
        return Instance.INSTANCE.getInstance();
    }
}
